package com.taoism.exception;

import com.taoism.customEnum.ResultEnum;

/**
 * 业务异常类
 *
 * @author chenrui
 * @version v1.0.0
 * @date 2017年1月6日下午12:31:20
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = -3191526578333403868L;
    protected ResultEnum code = ResultEnum.Business;

    public BusinessException(String msg) {
        this(ResultEnum.Business, msg);
    }

    public BusinessException(ResultEnum code, String msg) {
        super(msg);
        this.code = code;
    }

    public BusinessException(ResultEnum code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
    }

    public ResultEnum getCode() {
        return code;
    }
}
